FileSystemPackageReader.GetFileStream Method (string)

Returns a System.IO.Stream that can read the specified file.

Parent Type: FileSystemPackageReader

Namespace: Microsoft.LearningComponents

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public override Stream GetFileStream (
string filePath

)

Parameters

filePath

The package-relative path to the file. If this path indicates a file that is not in the package, a System.IO.FileNotFoundException is thrown.

Return Value

A System.IO.Stream for the specified file.

Exceptions
Exception type Condition
ArgumentException

filePath contains one or more invalid characters, or contains a wildcard character.

ArgumentNullException

filePath is a null reference.

PathTooLongException

The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

FileNotFoundException

The file specified was not found.

NotSupportedException

filePath is in an invalid format.

Permissions
Name Description
System.Security.Permissions.FileIOPermission

for reading files. Associated enumeration: System.Security.Permissions.FileIOPermissionAccess.Read.

Remarks

filePath is a relative path to the packageBasePath parameter of the FileSystemPackageReader constructor.